package com.SpringBootStudy.domian.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.stereotype.Component;

/**
 * @author SliverKiss
 * @apiNote
 * @date 2023/3/6
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Component
public class Person {
    private String name;
    private int age;
    private String sex;

    /**
     * 自我介绍
     */
    public void say() {
        System.out.println ( this.toString () );
    }

    @Override
    public String toString() {
        return "我叫" + name + ",年龄是" + age + "岁，是" + sex + "生。";
    }
}
